﻿@model smartcrm.Models.OrderModel
@{Layout = "../Shared/_PortalLayout.cshtml";}
<script src="../../Scripts/Portal/orderedit.js"></script>

<div id="divOrder">
    <div id="divOrderContent" style="min-height:240px">          
        @using (Html.BeginForm("","",FormMethod.Post,new {id="form1"}))        {
            <table id="tableEdit" class="font85 tableEdit" style="width:100%">
                <tr>
                    <td class="label" style="width:120px">订单编号</td>
                    <td style="width:200px">
                        @Html.TextBox("OrderNo", null, new { maxlength = "100",@readonly="true" }) 
                     </td>  
                     <td class="label">联系人</td>
                     <td>
                        @Html.DropDownList("ContactNo", new SelectList(Model.DdlContact, "ItemValue", "ItemText"))                    
                        @Html.Hidden("hContactNo")                
                        @Html.TextBox("Contact", null, new { maxlength = "100" })
                     </td>
                </tr>            
              
                <tr>
                    <td class="label">订单明细</td>
                    <td colspan="3" class="list">                        
                        <div class="FR" style="margin-bottom:5px"><input type="button" value="添加明细" id="aAddDetail" onclick="javascript:return addDetail()" /></div>
                        <table id="tdOrderDetail" style="width:100%">
                            <thead>
                            <tr>
                                <th style="width:50%">名称</th>
                                <th  style="width:20%">分类</th>
                                <th  style="width:20%">数量</th>                           
                                <th  style="width:10%">操作</th>
                            </tr>  
                            </thead>                           
                        </table>
                    </td>
                </tr>                           
            </table>          
        }
    </div>  
    <div style="text-align:right;">  
     <span id="errorMessage" class="errorSpan"></span>    &nbsp;&nbsp;&nbsp;&nbsp;
       <input type="button" id="btnSave" value="保存" />
       <input type="button" id="btnCancel" value="取消" />    
    </div>  
</div>  

<div id="divOrderDetail" title="订单明细信息" style="display:none">      
    <div id="divOrderDetailContent" style="overflow-y: auto; height: 380px;">         
   
        @using (Html.BeginForm("form2"))
        {
            <table id="tableEditDetail" class="font85 tableEdit">
                <tr>
                    <td class="label">名称</td>
                    <td>
                        @Html.TextBox("Content", null, new { maxlength = "100" })&nbsp;<span class="redStar">*</span>                                           
                    </td>
                </tr>
                <tr>
                    <td class="label">分类</td>
                    <td>
                       <select id="Category"></select>
                       <input type="hidden" id="ReportCategory" />
                    </td>
                </tr>                                
                <tr>
                    <td class="label"></td>
                    <td>                        
                        <table id="tableDetail" style="width:100%"></table>
                    </td>
                </tr>                
                <tr>
                     <td class="label">数量</td>
                    <td>
                        @Html.TextBox("Number", null, new { maxlength = "10" })&nbsp;<span class="redStar">*</span>                                           
                    </td>
                </tr>                        
                <tr>
                    <td class="label">备注</td>
                    <td>
                        @Html.TextArea("Memo", null, new { maxlength = "100" })
                    </td>
                </tr>               
            </table> 
                     
        }
    </div>  
    <div style="text-align:right;">  
    <span id="errorMessageDetail" class="errorSpan"></span>   &nbsp;&nbsp;&nbsp;&nbsp;
       <input type="button" id="btnDetailSave" value="保存"/>
       <input type="button" id="btnDetailCancel" value="取消" />        
       <input type="button" id="btnDetailClose" value="关闭" />            
    </div>  
</div> 
 
@Html.Hidden("IsAdd")
@Html.Hidden("OrderTemplate")